1. Field of the Invention
This invention relates to a technique for preventing program from being altered or modified.
2. Description of Related Art
Relating to program to be executed on a general computer system, there is such an important problem that a wicked user illegally alters the contents of the program and uses it. Particularly, program recorded on a storage medium such as a CD-ROM for sale is easily alterable. In order to prevent such illegal alteration of program, there is known a method of using a check program to check whether or not the program has been altered. For example, this is achieved as follows. First, a duplicate of a portion of a true program to be protected is prepared, and it is compared or collated with the corresponding portion of the program to be checked. If they are identical, the program is judged to be true and is executed. If they are not identical, the program is judged to be an altered one, and the execution of the program is inhibited. The portion to be compared or collated may be a part of the program itself or may be some codes prepared for the purpose of checking. Further, the portion to be compared may be encrypted or compressed, if necessary.
Examples of technique for preventing illegal alteration of program are disclosed in Japanese examined patent publication No. 62-3460, Japanese laid-open patent application No. 10-187435, and Japanese Patents Nos. 2621799 and 2738375.
Recently, however, some wicked users alter and disable such check program itself. In that case, the check method described above cannot prevent illegal alteration of program and execution of illegally-altered program.
It is an object of the present invention to provide a technique for preventing the illegal alteration of program, which is capable of reliably preventing the execution of the altered program even if the check program itself is altered.
According to one aspect of the present invention, there is provided a computer system including: reading means for reading a plurality of check program portions from a storage medium which carries computer program including the plurality of check program portions; and check program executing means for executing each of the check program portions, wherein each of the check program executing means detects alteration of at least one of other check program portions.
In the computer system thus configured, each of the check program executing means has a function to detect alteration of at least one other check program portion. Therefore, if one or some of the check program portions is altered, it can be detected by other check program portion. This can enhance the prevention of the alteration of program and use of the altered program.
The computer system may further include storage means for storing at least one check program prepared in advance. The check program portion stored in the storage means may detect alteration of at least one of the plurality of check program portions, and at least one of the plurality of check program portions may detect alteration of the check program portion stored in the storage means. By this, the multiple alteration detection can be achieved by the check program portion not only for the check program portions recorded on the storage medium but for the check program portion prepared in advance in the storage means of the computer system. Therefore, the alteration of program and use of the altered program may be avoided effectively.
The computer system may further include control means for enabling execution of the computer program when the check program executing means does not detect alteration of any one of the check program portions after executing all of the check program portions. By this, one of the check program portions can detect alteration unless all of the check program portions are successfully altered. Therefore, the alteration of program and use of the altered program may be avoided effectively.
The plurality of check program portions may be linked to form a loop structure such that each of the plurality of check program portions detects alteration of other one check program portion. Alternatively, the plurality of check program portions may be linked to form a tree structure such that each of the plurality of check program portions detects alteration of check program portions which belong to the each of the plurality of check program portions. By making the linked structure of the plural check programs complicated, the alteration of program and use of the altered program becomes practically impossible.
According to another aspect of the present invention, there is provided a method of executing computer program including the steps of: reading step for reading a plurality of check program portions from a storage medium which carries computer program including the plurality of check program portions; and check program executing step for executing all of the check program portions, wherein the check program executing step detects alteration of at least one of other check program portions.
In accordance with the above method, the check program executing step has a function to detect alteration of at least one other check program portion. Therefore, if one or some of the check program portions is altered, it can be detected by other check program portion. This can enhance the prevention of the alteration of program and use of the altered program.
The method may further include reading step for reading the check program portion from a storage means which stores at least one check program prepared in advance. The check program executing step may execute the check program portion stored in the storage means to detect alteration of at least one of the plurality of check program portions and may execute at least one of the plurality of check program portions to detect alteration of the check program portion stored in the storage means. By this, the multiple alteration detection can be achieved by plural check program portions not only for the check program portions recorded on the storage medium but for the check program portion prepared in advance in the storage means of the computer system. Therefore, the alteration of program and use of the altered program may be avoided more effectively.
The method may further include control step for enabling execution of the computer program when the check program executing step does not detect alteration of any one of the check program portion after executing all of the check program portions. By this, one of the check program portions can detect alteration unless all of the check program portions are successfully altered. Therefore, the alteration of program and use of the altered program may be avoided effectively.
According to still another aspect of the present invention, there is provided a storage medium readable by a computer, including: computer program; and a plurality of check program portions which allow the computer to perform as a check program executing means for detecting alteration of at least one of other check program portions.
Thus, each of the check program executing means has a function to detect alteration of at least one other check program portion. Therefore, if one or some of the check program portions is altered, it can be detected by other check program portion. This can enhance the prevention of the alteration of program and use of the altered program.
The storage medium may further include a program which allow the computer to perform as control means for enabling execution of the computer program when the check program executing means does not detect alteration of any one of the check program portions after executing all of the check program portions. By this, the multiple alteration detection can be achieved by plural check program portions not only for the check program portions recorded on the storage medium but for the check program portion prepared in advance in the storage means of the computer system. Therefore, the alteration of program and use of the altered program may be avoided more effectively.
The nature, utility, and further features of this invention will be more clearly apparent from the following detailed description with respect to the preferred embodiments of the invention when read in conjunction with the accompanying drawings briefly described below.